import axios from 'axios';

// 删除路由
let remove = (route_id, params) => axios.delete(`/route/${route_id}`, { params });

// 更新路由
let update = (route_id, data) => axios.put(`/route/${route_id}`, data);

// 添加路由
let add = (data) => axios.post('/route', data);

// 获取子级路由
let sub = (params) => axios.get('/route/sub', { params });

// 获取所有路由权限
let all = (params) => axios.get('/route/all', { params });

// 让函数能在别的页面用，要export
export default {
	remove,
	update,
	add,
	sub,
	all,
}
